/*
 * Copyright 2018 JDCLOUD.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * 京东云es接口
 * es相关接口
 *
 * OpenAPI spec version: v1
 * Contact: 
 *
 * NOTE: This class is auto generated by the jdcloud code generator program.
 */


using JDCloudSDK.Core.Auth;
using JDCloudSDK.Core.Client;
using JDCloudSDK.Core.Http;
using JDCloudSDK.Es.Apis;
using JDCloudSDK.Es.Model;
using System;
using System.Collections.Generic;
using System.Text;
#if NET40||NET35
#else
using System.Threading.Tasks;
#endif

namespace JDCloudSDK.Es.Client
{
    /// <summary>
    ///  京东云es接口
    ///  es相关接口
    ///  Es Api 客户端
    ///</summary>
    public class EsClient : JdcloudClient
    {

        /// <summary>
        ///  默认私有构造函数
        /// </summary>
        private EsClient()
        {

        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="environment">sdk 环境配置信息</param>
        public EsClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig,SDKEnvironment environment)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
            this.environment = environment;
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="credentialsProvider">认证信息</param>
        public EsClient(CredentialsProvider credentialsProvider,HttpRequestConfig httpRequestConfig)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        /// 默认构造函数，
        /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        public EsClient(CredentialsProvider credentialsProvider)
        {
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        ///  版本号 1.2.0
        ///</summary>
        public const string ClientVersion = "1.2.0";

        private const string apiVersion = "v1";
        private const string userAgentPrefix = "JdcloudSdkDotNet";
        private const string defaultEndpoint = "es.jdcloud-api.com";
        private const string serviceName = "es";
        private const string userAgent = userAgentPrefix + "/" + ClientVersion + " " + serviceName + "/" + apiVersion;


        private SDKEnvironment environment = new SDKEnvironment(defaultEndpoint);
        private CredentialsProvider credentialsProvider;
        private HttpRequestConfig httpRequestConfig;

        /// <summary>
        ///  获取证书信息
        ///</summary>
        public override CredentialsProvider CredentialsProvider   { get { return credentialsProvider; } }

        /// <summary>
        ///  获取http 客户端配置信息
        ///</summary>
        public override HttpRequestConfig HttpRequestConfig { get { return httpRequestConfig; } }

        /// <summary>
        ///  获取sdk环境配置信息
        ///</summary>
        public override SDKEnvironment SDKEnvironment { get { return environment; } }

        /// <summary>
        ///  获取用户自定义浏览器识别字符串
        ///</summary>
        public override string UserAgent { get { return userAgent; } }

        /// <summary>
        ///  获取服务名称
        ///</summary>
        public override string ServiceName { get { return serviceName; } }

        /// <summary>
        ///  获取版本号
        ///</summary>
        public override string Version { get { return apiVersion; } }



#if NET40||NET35
        /// <summary>
        ///  查询snapshot列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeSnapshotsResponse DescribeSnapshots(DescribeSnapshotsRequest request) {
            return  new DescribeSnapshotsExecutor().Client(this).Execute<DescribeSnapshotsResponse, DescribeSnapshotsResult, DescribeSnapshotsRequest>(request);
        }
#else
        /// <summary>
        ///  查询snapshot列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeSnapshotsResponse> DescribeSnapshots(DescribeSnapshotsRequest request) {
            return await new DescribeSnapshotsExecutor().Client(this).Execute<DescribeSnapshotsResponse, DescribeSnapshotsResult, DescribeSnapshotsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询设置的自动快照信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAutoSnapshotResponse DescribeAutoSnapshot(DescribeAutoSnapshotRequest request) {
            return  new DescribeAutoSnapshotExecutor().Client(this).Execute<DescribeAutoSnapshotResponse, DescribeAutoSnapshotResult, DescribeAutoSnapshotRequest>(request);
        }
#else
        /// <summary>
        ///  查询设置的自动快照信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAutoSnapshotResponse> DescribeAutoSnapshot(DescribeAutoSnapshotRequest request) {
            return await new DescribeAutoSnapshotExecutor().Client(this).Execute<DescribeAutoSnapshotResponse, DescribeAutoSnapshotResult, DescribeAutoSnapshotRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  设置身份验证信息。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ModifyAuthConfigResponse ModifyAuthConfig(ModifyAuthConfigRequest request) {
            return  new ModifyAuthConfigExecutor().Client(this).Execute<ModifyAuthConfigResponse, ModifyAuthConfigResult, ModifyAuthConfigRequest>(request);
        }
#else
        /// <summary>
        ///  设置身份验证信息。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ModifyAuthConfigResponse> ModifyAuthConfig(ModifyAuthConfigRequest request) {
            return await new ModifyAuthConfigExecutor().Client(this).Execute<ModifyAuthConfigResponse, ModifyAuthConfigResult, ModifyAuthConfigRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  上传本地字典文件并加载到es，支持主词库和停词库，主词库对象、停词库对象不可同时为空，也不可选择相同文件。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UploadDictResponse UploadDict(UploadDictRequest request) {
            return  new UploadDictExecutor().Client(this).Execute<UploadDictResponse, UploadDictResult, UploadDictRequest>(request);
        }
#else
        /// <summary>
        ///  上传本地字典文件并加载到es，支持主词库和停词库，主词库对象、停词库对象不可同时为空，也不可选择相同文件。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UploadDictResponse> UploadDict(UploadDictRequest request) {
            return await new UploadDictExecutor().Client(this).Execute<UploadDictResponse, UploadDictResult, UploadDictRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询实例索引模板定时任务列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeIndexTemplateCronTasksResponse DescribeIndexTemplateCronTasks(DescribeIndexTemplateCronTasksRequest request) {
            return  new DescribeIndexTemplateCronTasksExecutor().Client(this).Execute<DescribeIndexTemplateCronTasksResponse, DescribeIndexTemplateCronTasksResult, DescribeIndexTemplateCronTasksRequest>(request);
        }
#else
        /// <summary>
        ///  查询实例索引模板定时任务列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeIndexTemplateCronTasksResponse> DescribeIndexTemplateCronTasks(DescribeIndexTemplateCronTasksRequest request) {
            return await new DescribeIndexTemplateCronTasksExecutor().Client(this).Execute<DescribeIndexTemplateCronTasksResponse, DescribeIndexTemplateCronTasksResult, DescribeIndexTemplateCronTasksRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询索引模板定时任务详细信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeIndexTemplateCronTaskResponse DescribeIndexTemplateCronTask(DescribeIndexTemplateCronTaskRequest request) {
            return  new DescribeIndexTemplateCronTaskExecutor().Client(this).Execute<DescribeIndexTemplateCronTaskResponse, DescribeIndexTemplateCronTaskResult, DescribeIndexTemplateCronTaskRequest>(request);
        }
#else
        /// <summary>
        ///  查询索引模板定时任务详细信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeIndexTemplateCronTaskResponse> DescribeIndexTemplateCronTask(DescribeIndexTemplateCronTaskRequest request) {
            return await new DescribeIndexTemplateCronTaskExecutor().Client(this).Execute<DescribeIndexTemplateCronTaskResponse, DescribeIndexTemplateCronTaskResult, DescribeIndexTemplateCronTaskRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取用户支持的特定功能
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeSpecialFeaturesResponse DescribeSpecialFeatures(DescribeSpecialFeaturesRequest request) {
            return  new DescribeSpecialFeaturesExecutor().Client(this).Execute<DescribeSpecialFeaturesResponse, DescribeSpecialFeaturesResult, DescribeSpecialFeaturesRequest>(request);
        }
#else
        /// <summary>
        ///  获取用户支持的特定功能
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeSpecialFeaturesResponse> DescribeSpecialFeatures(DescribeSpecialFeaturesRequest request) {
            return await new DescribeSpecialFeaturesExecutor().Client(this).Execute<DescribeSpecialFeaturesResponse, DescribeSpecialFeaturesResult, DescribeSpecialFeaturesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  变更es实例的配置，实例为running状态才可变更配置，每次只能变更一种且不可与原来的相同。
        /// 实例配置（cpu核数、内存、磁盘容量、节点数量）目前只允许变大
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ModifyInstanceSpecResponse ModifyInstanceSpec(ModifyInstanceSpecRequest request) {
            return  new ModifyInstanceSpecExecutor().Client(this).Execute<ModifyInstanceSpecResponse, ModifyInstanceSpecResult, ModifyInstanceSpecRequest>(request);
        }
#else
        /// <summary>
        ///  变更es实例的配置，实例为running状态才可变更配置，每次只能变更一种且不可与原来的相同。
        /// 实例配置（cpu核数、内存、磁盘容量、节点数量）目前只允许变大
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ModifyInstanceSpecResponse> ModifyInstanceSpec(ModifyInstanceSpecRequest request) {
            return await new ModifyInstanceSpecExecutor().Client(this).Execute<ModifyInstanceSpecResponse, ModifyInstanceSpecResult, ModifyInstanceSpecRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  关闭自定义字典。同时清除用户已上传的字典
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DisableDictsResponse DisableDicts(DisableDictsRequest request) {
            return  new DisableDictsExecutor().Client(this).Execute<DisableDictsResponse, DisableDictsResult, DisableDictsRequest>(request);
        }
#else
        /// <summary>
        ///  关闭自定义字典。同时清除用户已上传的字典
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DisableDictsResponse> DisableDicts(DisableDictsRequest request) {
            return await new DisableDictsExecutor().Client(this).Execute<DisableDictsResponse, DisableDictsResult, DisableDictsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除按配置计费或包年包月已到期的es实例，包年包月未到期不可删除。
        /// 状态为创建中和变配中的不可删除。
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteInstanceResponse DeleteInstance(DeleteInstanceRequest request) {
            return  new DeleteInstanceExecutor().Client(this).Execute<DeleteInstanceResponse, DeleteInstanceResult, DeleteInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  删除按配置计费或包年包月已到期的es实例，包年包月未到期不可删除。
        /// 状态为创建中和变配中的不可删除。
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteInstanceResponse> DeleteInstance(DeleteInstanceRequest request) {
            return await new DeleteInstanceExecutor().Client(this).Execute<DeleteInstanceResponse, DeleteInstanceResult, DeleteInstanceRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  手动创建一个snapshot。手动创建快照将由您定义快照名称前缀和索引，如果没有设置索引，将创建集群全部索引的快照。如果想要备份指定的索引，需要指定具体的索引名称，例如&#39;index1,index2,index3&#39;，使用逗号隔开。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateSnapshotResponse CreateSnapshot(CreateSnapshotRequest request) {
            return  new CreateSnapshotExecutor().Client(this).Execute<CreateSnapshotResponse, CreateSnapshotResult, CreateSnapshotRequest>(request);
        }
#else
        /// <summary>
        ///  手动创建一个snapshot。手动创建快照将由您定义快照名称前缀和索引，如果没有设置索引，将创建集群全部索引的快照。如果想要备份指定的索引，需要指定具体的索引名称，例如&#39;index1,index2,index3&#39;，使用逗号隔开。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateSnapshotResponse> CreateSnapshot(CreateSnapshotRequest request) {
            return await new CreateSnapshotExecutor().Client(this).Execute<CreateSnapshotResponse, CreateSnapshotResult, CreateSnapshotRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  仅当实例状态为running时可以调用，停止es实例的访问
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public StopInstanceResponse StopInstance(StopInstanceRequest request) {
            return  new StopInstanceExecutor().Client(this).Execute<StopInstanceResponse, StopInstanceResult, StopInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  仅当实例状态为running时可以调用，停止es实例的访问
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<StopInstanceResponse> StopInstance(StopInstanceRequest request) {
            return await new StopInstanceExecutor().Client(this).Execute<StopInstanceResponse, StopInstanceResult, StopInstanceRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询es实例名称
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public SelectDetailListResponse SelectDetailList(SelectDetailListRequest request) {
            return  new SelectDetailListExecutor().Client(this).Execute<SelectDetailListResponse, SelectDetailListResult, SelectDetailListRequest>(request);
        }
#else
        /// <summary>
        ///  查询es实例名称
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<SelectDetailListResponse> SelectDetailList(SelectDetailListRequest request) {
            return await new SelectDetailListExecutor().Client(this).Execute<SelectDetailListResponse, SelectDetailListResult, SelectDetailListRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询es实例的详细信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeInstanceResponse DescribeInstance(DescribeInstanceRequest request) {
            return  new DescribeInstanceExecutor().Client(this).Execute<DescribeInstanceResponse, DescribeInstanceResult, DescribeInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  查询es实例的详细信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeInstanceResponse> DescribeInstance(DescribeInstanceRequest request) {
            return await new DescribeInstanceExecutor().Client(this).Execute<DescribeInstanceResponse, DescribeInstanceResult, DescribeInstanceRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取es配置信息，包括版本、规格详情和AZ的配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeInstanceSpecConfResponse DescribeInstanceSpecConf(DescribeInstanceSpecConfRequest request) {
            return  new DescribeInstanceSpecConfExecutor().Client(this).Execute<DescribeInstanceSpecConfResponse, DescribeInstanceSpecConfResult, DescribeInstanceSpecConfRequest>(request);
        }
#else
        /// <summary>
        ///  获取es配置信息，包括版本、规格详情和AZ的配置
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeInstanceSpecConfResponse> DescribeInstanceSpecConf(DescribeInstanceSpecConfRequest request) {
            return await new DescribeInstanceSpecConfExecutor().Client(this).Execute<DescribeInstanceSpecConfResponse, DescribeInstanceSpecConfResult, DescribeInstanceSpecConfRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询当前的身份验证设置信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAuthConfigResponse DescribeAuthConfig(DescribeAuthConfigRequest request) {
            return  new DescribeAuthConfigExecutor().Client(this).Execute<DescribeAuthConfigResponse, DescribeAuthConfigResult, DescribeAuthConfigRequest>(request);
        }
#else
        /// <summary>
        ///  查询当前的身份验证设置信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAuthConfigResponse> DescribeAuthConfig(DescribeAuthConfigRequest request) {
            return await new DescribeAuthConfigExecutor().Client(this).Execute<DescribeAuthConfigResponse, DescribeAuthConfigResult, DescribeAuthConfigRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  根据pin获取es实例的资产信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAssetsResponse DescribeAssets(DescribeAssetsRequest request) {
            return  new DescribeAssetsExecutor().Client(this).Execute<DescribeAssetsResponse, DescribeAssetsResult, DescribeAssetsRequest>(request);
        }
#else
        /// <summary>
        ///  根据pin获取es实例的资产信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAssetsResponse> DescribeAssets(DescribeAssetsRequest request) {
            return await new DescribeAssetsExecutor().Client(this).Execute<DescribeAssetsResponse, DescribeAssetsResult, DescribeAssetsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询es实例节点列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeInstanceNodesResponse DescribeInstanceNodes(DescribeInstanceNodesRequest request) {
            return  new DescribeInstanceNodesExecutor().Client(this).Execute<DescribeInstanceNodesResponse, DescribeInstanceNodesResult, DescribeInstanceNodesRequest>(request);
        }
#else
        /// <summary>
        ///  查询es实例节点列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeInstanceNodesResponse> DescribeInstanceNodes(DescribeInstanceNodesRequest request) {
            return await new DescribeInstanceNodesExecutor().Client(this).Execute<DescribeInstanceNodesResponse, DescribeInstanceNodesResult, DescribeInstanceNodesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除索引模板定时任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteIndexTemplateCronTaskResponse DeleteIndexTemplateCronTask(DeleteIndexTemplateCronTaskRequest request) {
            return  new DeleteIndexTemplateCronTaskExecutor().Client(this).Execute<DeleteIndexTemplateCronTaskResponse, DeleteIndexTemplateCronTaskResult, DeleteIndexTemplateCronTaskRequest>(request);
        }
#else
        /// <summary>
        ///  删除索引模板定时任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteIndexTemplateCronTaskResponse> DeleteIndexTemplateCronTask(DeleteIndexTemplateCronTaskRequest request) {
            return await new DeleteIndexTemplateCronTaskExecutor().Client(this).Execute<DeleteIndexTemplateCronTaskResponse, DeleteIndexTemplateCronTaskResult, DeleteIndexTemplateCronTaskRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取es实例已上传的字典文件名
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeDictsResponse DescribeDicts(DescribeDictsRequest request) {
            return  new DescribeDictsExecutor().Client(this).Execute<DescribeDictsResponse, DescribeDictsResult, DescribeDictsRequest>(request);
        }
#else
        /// <summary>
        ///  获取es实例已上传的字典文件名
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeDictsResponse> DescribeDicts(DescribeDictsRequest request) {
            return await new DescribeDictsExecutor().Client(this).Execute<DescribeDictsResponse, DescribeDictsResult, DescribeDictsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  连接es前认证校验。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CheckAuthResponse CheckAuth(CheckAuthRequest request) {
            return  new CheckAuthExecutor().Client(this).Execute<CheckAuthResponse, CheckAuthResult, CheckAuthRequest>(request);
        }
#else
        /// <summary>
        ///  连接es前认证校验。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CheckAuthResponse> CheckAuth(CheckAuthRequest request) {
            return await new CheckAuthExecutor().Client(this).Execute<CheckAuthResponse, CheckAuthResult, CheckAuthRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改索引模板定时任务，会将原任务删掉后再创建新任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ModifyIndexTemplateCronTaskResponse ModifyIndexTemplateCronTask(ModifyIndexTemplateCronTaskRequest request) {
            return  new ModifyIndexTemplateCronTaskExecutor().Client(this).Execute<ModifyIndexTemplateCronTaskResponse, ModifyIndexTemplateCronTaskResult, ModifyIndexTemplateCronTaskRequest>(request);
        }
#else
        /// <summary>
        ///  修改索引模板定时任务，会将原任务删掉后再创建新任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ModifyIndexTemplateCronTaskResponse> ModifyIndexTemplateCronTask(ModifyIndexTemplateCronTaskRequest request) {
            return await new ModifyIndexTemplateCronTaskExecutor().Client(this).Execute<ModifyIndexTemplateCronTaskResponse, ModifyIndexTemplateCronTaskResult, ModifyIndexTemplateCronTaskRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  设置自动快照
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public ModifyAutoSnapshotResponse ModifyAutoSnapshot(ModifyAutoSnapshotRequest request) {
            return  new ModifyAutoSnapshotExecutor().Client(this).Execute<ModifyAutoSnapshotResponse, ModifyAutoSnapshotResult, ModifyAutoSnapshotRequest>(request);
        }
#else
        /// <summary>
        ///  设置自动快照
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<ModifyAutoSnapshotResponse> ModifyAutoSnapshot(ModifyAutoSnapshotRequest request) {
            return await new ModifyAutoSnapshotExecutor().Client(this).Execute<ModifyAutoSnapshotResponse, ModifyAutoSnapshotResult, ModifyAutoSnapshotRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询es实例列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeInstancesResponse DescribeInstances(DescribeInstancesRequest request) {
            return  new DescribeInstancesExecutor().Client(this).Execute<DescribeInstancesResponse, DescribeInstancesResult, DescribeInstancesRequest>(request);
        }
#else
        /// <summary>
        ///  查询es实例列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeInstancesResponse> DescribeInstances(DescribeInstancesRequest request) {
            return await new DescribeInstancesExecutor().Client(this).Execute<DescribeInstancesResponse, DescribeInstancesResult, DescribeInstancesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  当实例状态为stop时可以调用，开启es实例访问
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public StartInstanceResponse StartInstance(StartInstanceRequest request) {
            return  new StartInstanceExecutor().Client(this).Execute<StartInstanceResponse, StartInstanceResult, StartInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  当实例状态为stop时可以调用，开启es实例访问
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<StartInstanceResponse> StartInstance(StartInstanceRequest request) {
            return await new StartInstanceExecutor().Client(this).Execute<StartInstanceResponse, StartInstanceResult, StartInstanceRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  重启实例接口，提供强制重启与滚动重启，两种重启方式
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public RestartInstanceResponse RestartInstance(RestartInstanceRequest request) {
            return  new RestartInstanceExecutor().Client(this).Execute<RestartInstanceResponse, RestartInstanceResult, RestartInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  重启实例接口，提供强制重启与滚动重启，两种重启方式
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<RestartInstanceResponse> RestartInstance(RestartInstanceRequest request) {
            return await new RestartInstanceExecutor().Client(this).Execute<RestartInstanceResponse, RestartInstanceResult, RestartInstanceRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  水平缩容时，判断可以最小缩容到几个节点
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeShrinkInstanceLimitNodeCountResponse DescribeShrinkInstanceLimitNodeCount(DescribeShrinkInstanceLimitNodeCountRequest request) {
            return  new DescribeShrinkInstanceLimitNodeCountExecutor().Client(this).Execute<DescribeShrinkInstanceLimitNodeCountResponse, DescribeShrinkInstanceLimitNodeCountResult, DescribeShrinkInstanceLimitNodeCountRequest>(request);
        }
#else
        /// <summary>
        ///  水平缩容时，判断可以最小缩容到几个节点
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeShrinkInstanceLimitNodeCountResponse> DescribeShrinkInstanceLimitNodeCount(DescribeShrinkInstanceLimitNodeCountRequest request) {
            return await new DescribeShrinkInstanceLimitNodeCountExecutor().Client(this).Execute<DescribeShrinkInstanceLimitNodeCountResponse, DescribeShrinkInstanceLimitNodeCountResult, DescribeShrinkInstanceLimitNodeCountRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询实例索引模板列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeIndexTemplatesResponse DescribeIndexTemplates(DescribeIndexTemplatesRequest request) {
            return  new DescribeIndexTemplatesExecutor().Client(this).Execute<DescribeIndexTemplatesResponse, DescribeIndexTemplatesResult, DescribeIndexTemplatesRequest>(request);
        }
#else
        /// <summary>
        ///  查询实例索引模板列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeIndexTemplatesResponse> DescribeIndexTemplates(DescribeIndexTemplatesRequest request) {
            return await new DescribeIndexTemplatesExecutor().Client(this).Execute<DescribeIndexTemplatesResponse, DescribeIndexTemplatesResult, DescribeIndexTemplatesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除单个字典文件
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteDictResponse DeleteDict(DeleteDictRequest request) {
            return  new DeleteDictExecutor().Client(this).Execute<DeleteDictResponse, DeleteDictResult, DeleteDictRequest>(request);
        }
#else
        /// <summary>
        ///  删除单个字典文件
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteDictResponse> DeleteDict(DeleteDictRequest request) {
            return await new DeleteDictExecutor().Client(this).Execute<DeleteDictResponse, DeleteDictResult, DeleteDictRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询索引模板详细信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeIndexTemplateResponse DescribeIndexTemplate(DescribeIndexTemplateRequest request) {
            return  new DescribeIndexTemplateExecutor().Client(this).Execute<DescribeIndexTemplateResponse, DescribeIndexTemplateResult, DescribeIndexTemplateRequest>(request);
        }
#else
        /// <summary>
        ///  查询索引模板详细信息
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeIndexTemplateResponse> DescribeIndexTemplate(DescribeIndexTemplateRequest request) {
            return await new DescribeIndexTemplateExecutor().Client(this).Execute<DescribeIndexTemplateResponse, DescribeIndexTemplateResult, DescribeIndexTemplateRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  针对某个索引模板，创建定时任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateIndexTemplateCronTaskResponse CreateIndexTemplateCronTask(CreateIndexTemplateCronTaskRequest request) {
            return  new CreateIndexTemplateCronTaskExecutor().Client(this).Execute<CreateIndexTemplateCronTaskResponse, CreateIndexTemplateCronTaskResult, CreateIndexTemplateCronTaskRequest>(request);
        }
#else
        /// <summary>
        ///  针对某个索引模板，创建定时任务
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateIndexTemplateCronTaskResponse> CreateIndexTemplateCronTask(CreateIndexTemplateCronTaskRequest request) {
            return await new CreateIndexTemplateCronTaskExecutor().Client(this).Execute<CreateIndexTemplateCronTaskResponse, CreateIndexTemplateCronTaskResult, CreateIndexTemplateCronTaskRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建一个指定配置的es实例
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateInstanceResponse CreateInstance(CreateInstanceRequest request) {
            return  new CreateInstanceExecutor().Client(this).Execute<CreateInstanceResponse, CreateInstanceResult, CreateInstanceRequest>(request);
        }
#else
        /// <summary>
        ///  创建一个指定配置的es实例
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateInstanceResponse> CreateInstance(CreateInstanceRequest request) {
            return await new CreateInstanceExecutor().Client(this).Execute<CreateInstanceResponse, CreateInstanceResult, CreateInstanceRequest>(request).ConfigureAwait(false);
        }
#endif

            /// <summary>
            ///  默认EsClient 构造器 接口
            ///</summary>
            public interface Builder
            {

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>esClient 构造器</returns>
                Builder CredentialsProvider(CredentialsProvider provider);

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>esClient 构造器</returns>
                Builder Environment(Core.Client.SDKEnvironment environment);

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>esClient 构造器</returns>
                Builder HttpRequestConfig(HttpRequestConfig config);

                /// <summary>
                ///  构造EsClient 对象
                ///</summary>
                EsClient Build();
            }

            /// <summary>
            ///  默认EsClient 构造器
            ///</summary>
            public class DefaultBuilder : Builder
            {
                /// <summary>
                ///  EsClient service client
                /// </summary>
                private  EsClient esClient;

                /// <summary>
                ///  默认EsClient 构造器构造对象
                ///</summary>
                public DefaultBuilder()
                {
                    esClient = new EsClient();
                }

                /// <summary>
                ///  构造EsClient 对象
                ///</summary>
                public EsClient Build()
                {
                    if (esClient.CredentialsProvider == null)
                    {
                        //if credentialsProvider not set, try load jdcloud global default  credentials provider
                        esClient.credentialsProvider = JdCloud.DefaultInstance.GetCredentialsProvider();
                        if (esClient.credentialsProvider == null)
                        {
                            throw new ArgumentNullException("EsClient build error: jdcloud credentials provider not set");
                        }
                    }
                    if (esClient.HttpRequestConfig == null)
                    {
                        esClient.httpRequestConfig = JdCloud.DefaultInstance.GetHttpRequestConfig();
                        if (esClient.httpRequestConfig == null)
                        {
                        throw new ArgumentNullException("EsClient build error: http request config not set");
                        }
                    }
                    return esClient;
                }

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>esClient 构造器</returns>
                public Builder CredentialsProvider(CredentialsProvider provider)
                {
                    esClient.credentialsProvider = provider;
                    return this;
                }

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>esClient 构造器</returns>
                public Builder Environment(SDKEnvironment environment)
                {
                    esClient.environment = environment;
                    return this;
                }

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>esClient 构造器</returns>
                public Builder HttpRequestConfig(HttpRequestConfig config)
                {
                    esClient.httpRequestConfig = config;
                    return this;
                }
            }
    }
}
